package com.xxxx.server.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xxxx.server.mapper.NoticeMapper;
import com.xxxx.server.pojo.Employee;
import com.xxxx.server.pojo.Notice;
import com.xxxx.server.pojo.RespPageBean;
import com.xxxx.server.service.INoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;

@Service
public class NoticeServiceImpl extends ServiceImpl<NoticeMapper,Notice> implements INoticeService {
    @Autowired
    private NoticeMapper noticeMapper;

   @Override
    public RespPageBean findList(Integer currentPage, Integer size, Notice notice) {
        //开启分页
        Page<Notice> page = new Page<>(currentPage, size);
        IPage<Notice> noticeByPage = this.page(page);
        RespPageBean respPageBeanNotice = new RespPageBean(noticeByPage.getTotal(), noticeByPage.getRecords());

        return respPageBeanNotice;
    }

}
